export default {
  state: {
    goodsList: [],
  },
  mutations: {
    ADD_GOODS(state, payload) {
      state.goodsList = [
        {
          ...payload,
          addTime: Date.now(),
          id: Math.random().toString(36).slice(2) + Date.now(),
        },
        ...state.goodsList,
      ]
    },
  },
}
